﻿using System.Net;
using System.Net.Mail;

namespace NiuX.Utils.Utils.Models;

public class EmailOptions
{
    public string Host { get; set; } = "smtp.qq.com";

    public string UserName { get; set; }
    public string Password { get; set; }

    public SmtpClient CreateSmtpClient() => new SmtpClient
    {
        //smtp服务器地址
        Host = Host,
        UseDefaultCredentials = true,
        DeliveryMethod = SmtpDeliveryMethod.Network,
        //这里输入你在发送smtp服务器的用户名和密码
        Credentials = new NetworkCredential(UserName, Password)
    };
}